package com.bootcamp.javase.inner;

/**
 * @program: InnerCode
 * @description: a Dog class and an inner class
 * @author: Keyu Li
 * @create: 2021-09-03 20:55
 **/

public class TestDog {
    public static void main(String[] args) {
        Dog dg = new Dog("WW", 12, "black");
        dg.showDog();
    }
}

class Dog {
    private int age;
    private String name;
    private Body bd;

    private class Body {
        private String color;

        public Body() {
        }

        public Body(String color) {
            this.color = color;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

    }
    private Dog(){
    }

    public Dog(String name, int age, String color) {
        this.age = age;
        this.name = name;
        bd = new Body(color);
    }

    public void showDog() {
        System.out.println("name: " + this.name + ", age: " + this.age + ", color: " + this.bd.color);
    }
}
